package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

/**
 * @author 韩先楚
 */
@Mapper
public interface UserMapper {

    /**
     * 根据openid查询用户信息
     */
    @Select("select * from user where openid = #{openid};")
    User getUserByOpenid(String openid);

    /**
     * 增加用户信息
     * @param userByOpenid
     */

    void insertUser(User userByOpenid);

    /**
     * 统计用户比Date小数量
     * @param date1
     * @return
     */
    @Select("select count(*) from user where create_time < #{date1};")
    Integer countByDate(LocalDateTime date1);
}
